<!doctype html>
<head>
        <meta name="keywords" content="羽毛球，球会，球场，教练">
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/index.css">
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/jquery.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/bootstrap.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/md5.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/jquery-form.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/layer-v2.1/layer/layer.js"></script>
</head>		



		<div class="edit_user_info">
        <!-- <div><span >用户图片: </span></div>	
        <div><img id="user_picture" src=""></img></div> -->		
		<div><span class="css_class">用户名称: </span><input id="name"></input></div>
		
		<div><span class="css_class">性别: </span><input id="gender"></input></div>
		<div><span class="css_class">邮箱: </span><input id="email"></input></div>
		<div><span class="css_class">手机: </span><input id="phone"></input></div>
		<div><span class="css_class">最后登录时间: </span><input id="last_login_time"></input></div>
        <button onclick="ensure()">确定</button>
        </div>
        	
        <script type="text/javascript">
       
       $(function(){
	          $.post('__URL__/showUserInfo',{},function(result){ 			   
			  userJson=result;
			  if (userJson!=null)
			  {
              document.getElementById("name").value=userJson.name;
			  if (userJson.gender==0) 
			  document.getElementById("gender").value="男";
			  else
			  document.getElementById("gender").value="女";
			  document.getElementById("email").value=userJson.email;
			  document.getElementById("phone").value=userJson.phone;
			  document.getElementById("last_login_time").value=userJson.last_login_time;
			  //document.getElementById("user_picture").src=userJson.user_picture;
			  }
			  else
			  {
			    alert("请先登录");
			  }
    	     },'json');  
			
		});
		function ensure()
		{
		  var name=document.getElementById("name").value;
		  var gender=document.getElementById("gender").value;
		  var email=document.getElementById("email").value;
		  var phone=document.getElementById("phone").value;
		  $.post('__URL__/changeInformation',{'name':name,'gender':gender,'email':email,'phone':phone},function(resultList){
		     var msg=resultList.changeInformationResult;
			 if (msg==0)
			 {
			   //layer.closeAll();
			   //alert(document.cookie["username"]);
			   //document.cookie="username="+name;
			   layer.msg("修改成功");
			   
			 }
			 else
			 {
			   //layer.msg(msg);
			   layer.msg("修改失败");
			 }
		  },'json'); 
           		  
		}
</script>